package com.shanzmoo.base.constant;

/**
 * 异常返回枚举
 * @author: Gzhao 2020/11/6
 */
public enum ErrorCode {
    /**
     * 未认证
     */
    NOT_AUTH(300401, "未认证"),
    NOT_AUTH_BAD_CREDENTIALS(300402, "账号或密码错误"),

    TOKEN_INSUFFICIENT(300403, "Token已过期"),
    JWT_VALIDATE_FAIL(300404, "jwt 验证失败"),
    AUTH_LOCKED(300405, "用户已锁定"),
    NOT_AUTHORIZE(300411, "未授权"),
    SYS_PARAM_ERROR(300501, "参数异常"),
    SYS_INTERNAL_ERROR(300502, "逻辑异常"),
    ;

    private int code;
    private String desc;

    ErrorCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int code() {
        return code;
    }

    public String desc() {
        return desc;
    }
}
